#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/tcp.h>
#include <linux/ip.h>
#include <linux/proc_fs.h>
#include <net/ip.h>

static struct proc_dir_entry *proc_mtd;
static char ProcBuffer[50000];
static char Temp1[1000],Temp2[1000];		
extern int eeAckCount;
static int WritingLength;

static int procfile_read(char *buffer,char **buffer_location,off_t offset,int buffer_length,int zero)
{
    int len,ReturnLength;
    if(offset >0) return 0;

    WritingLength=0;
    
    sprintf(Temp1,"eeAckCount=%d\x0D\x0A",eeAckCount++);

    if(WritingLength+strlen(Temp1) < 50000)
    {
        memcpy(&ProcBuffer[WritingLength],Temp1,strlen(Temp1));
        WritingLength+=strlen(Temp1);
    }

    *buffer_location = ProcBuffer;
    ReturnLength=WritingLength;
    WritingLength=0;
    return ReturnLength;
}

int init_module(void)
{	
	if ((proc_mtd = create_proc_entry("eee-dev", 0, 0 )))proc_mtd->read_proc = procfile_read;
	printk("SimpleProc: SimpleProc install ok! \n");	
	return 0;
}
void cleanup_module(void)
{
	eeAckCount=0;
	if (proc_mtd)remove_proc_entry( "eee-dev", 0);
	printk("SimpleProc uninstall successful! \n");
}
MODULE_LICENSE("GPL");
